module ActiveTest #:nodoc:
  module Asserts #:nodoc:
    module Validations

      # Assert that an error has occurred on a certain field of a model instance.
      #   assert_error_on @user, :password
      def assert_error_on(model, field)
        assert !model.errors[field.to_sym].nil?, "No validation error on the #{field.to_s} field."
      end

      # Assert that there is no error on a certain field of a model instance.
      #   assert_no_error_on @user, :password
      def assert_no_error_on(model, field)
        assert model.errors[field.to_sym].nil?, "Validation error on #{field.to_s}."
      end
      
    end
  end
end